import 'package:lcapp/data/media_asset_data_entity.dart';

mediaAssetDataEntityFromJson(MediaAssetDataEntity data, Map<String, dynamic> json) {
	if (json['id'] != null) {
		data.id = json['id'] is String
				? int.tryParse(json['id'])
				: json['id'].toInt();
	}
	if (json['seq'] != null) {
		data.seq = json['seq'] is String
				? int.tryParse(json['seq'])
				: json['seq'].toInt();
	}
	if (json['type'] != null) {
		data.type = json['type'] is String
				? int.tryParse(json['type'])
				: json['type'].toInt();
	}
	if (json['mediaType'] != null) {
		data.mediaType = json['mediaType'] is String
				? int.tryParse(json['mediaType'])
				: json['mediaType'].toInt();
	}
	if (json['videoDuration'] != null) {
		data.videoDuration = json['videoDuration'] is String
				? int.tryParse(json['videoDuration'])
				: json['videoDuration'].toInt();
	}
	if (json['uri'] != null) {
		data.uri = json['uri'].toString();
	}
	if (json['url'] != null) {
		data.url = json['url'].toString();
	}
	if (json['videoCoverUri'] != null) {
		data.videoCoverUri = json['videoCoverUri'].toString();
	}
	if (json['videoCoverUrl'] != null) {
		data.videoCoverUrl = json['videoCoverUrl'].toString();
	}
	if (json['uploadPath'] != null) {
		data.uploadPath = json['uploadPath'].toString();
	}
	if (json['videoUploadPath'] != null) {
		data.videoUploadPath = json['videoUploadPath'].toString();
	}
	if (json['title'] != null) {
		data.title = json['title'].toString();
	}
	if (json['ext'] != null) {
		data.ext = json['ext'].toString();
	}
	if (json['mediaId'] != null) {
		data.mediaId = json['mediaId'].toString();
	}
	return data;
}

Map<String, dynamic> mediaAssetDataEntityToJson(MediaAssetDataEntity entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['id'] = entity.id;
	data['seq'] = entity.seq;
	data['type'] = entity.type;
	data['mediaType'] = entity.mediaType;
	data['videoDuration'] = entity.videoDuration;
	data['uri'] = entity.uri;
	data['url'] = entity.url;
	data['videoCoverUri'] = entity.videoCoverUri;
	data['videoCoverUrl'] = entity.videoCoverUrl;
	data['uploadPath'] = entity.uploadPath;
	data['videoUploadPath'] = entity.videoUploadPath;
	data['title'] = entity.title;
	data['ext'] = entity.ext;
	data['mediaId'] = entity.mediaId;
	return data;
}